% need to fix this to account for the fact that
% some elements in C or Z are zero

function CES_agg = CES_agg(c,z,psi,rho)

%if (psi<=1)

%  c(c==0) 


%CES_agg = ((1-rho)*c.^(1-1/psi) + rho*z.^(1-1/psi)).^(1/(1-1/psi));

CES_agg = ((1-rho)*c.^(1-1/psi) + rho*z.^(1-1/psi)).^(1/(1-1/psi));


end
